package top.z.work.module.system.controller.route.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import top.z.work.framework.common.constant.DataStatus;
import top.z.work.framework.common.constant.DataVisible;
import top.z.work.module.system.constant.MenuTypeEnum;

@Data
@Accessors(chain = true)
@Schema(description = "系统管理 - 创建路由数据 VO")
public class SystemRouteCreateVO {

    @NotBlank(message = "上级路由主键不能为空")
    @Schema(description = "上级路由主键", example = "0")
    private Long parent;

    @Length(min = 2, max = 50, message = "路由名称长度只能在2到50个字符之间")
    @NotBlank(message = "路由名称不能为空")
    @Schema(description = "路由名称", example = "用户管理")
    private String name;

    @Schema(description = "路由图标", example = "UserRole")
    private String icon;

    @Schema(description = "权限标识", example = "system:user:view")
    private String authority;

    @Schema(description = "路由地址", example = "system/user/index")
    private String path;

    @Schema(description = "路由组件", example = "system/user/index")
    private String component;

    @NotBlank(message = "路由类型不能为空")
    @Schema(description = "路由类型", example = "1", implementation = MenuTypeEnum.class)
    private Integer type;

    @Schema(description = "路由排序", example = "1")
    private Integer sort;

    @Min(value = 0, message = "显示状态只能是0或者1")
    @Max(value = 1, message = "显示状态只能是0或者1")
    @NotBlank(message = "显示状态不能为空")
    @Schema(description = "显示状态", example = "1", implementation = DataVisible.class)
    private Integer visible;

    @Min(value = 0, message = "状态只能是0或者1")
    @Max(value = 1, message = "状态只能是0或者1")
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态", example = "0", implementation = DataStatus.class)
    private Integer status;

}
